<?php
//用curl发送post请求
$url='http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]; 
$server=dirname($url)."/server.php";
$post_data = array ("username" => "bob","key" => "12345");

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $server);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);// POST方式发送
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);// post的数据
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);